package com.chang;

import com.chang.impl.ClassRoom;
import com.chang.impl.Student;
import lombok.ToString;

import java.util.Arrays;
import java.util.Iterator;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        ClassRoom classRoom = new ClassRoom();
        classRoom.add(new Student().setName("小米").setAge(12));
        classRoom.add(new Student().setName("小w").setAge(13));
        Iterator iterator = classRoom.createIterator();

        for (int i = 0; i < classRoom.size(); i++) {
            System.out.println(classRoom.get(i));
        }


        while (iterator.hasNext()) {
            Student student = (Student) iterator.next();
            System.out.println(student);
        }
    }
}
